package com.sun.concurrent;

/**
 * Created by sun on 2017/1/10.
 */
public class AddMoneyThread implements Runnable {

    private Account account;
    private double money;

    public AddMoneyThread(Account account,double money) {
        this.account = account;
        this.money = money;
    }

    public void run() {
        synchronized (account) {
            account.deposit(money);
        }

    }
}
